package com.gmail.huxiaowi.cblog.service;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import com.gmail.huxiaowi.cblog.entity.Article;
import com.gmail.huxiaowi.cblog.entity.Category;
import com.gmail.huxiaowi.cblog.entity.Comment;
import com.gmail.huxiaowi.cblog.entity.Message;

/**
 * Class UserBiz
 * 
 * @author  huxw
 * @version $Revision:1.0.0, $Date:2010-4-29 下午05:47:44$
 */
public interface IUserService {
    /**
     * 获得所有文章数
     * @return
     */
    int getAllArticleSize();
    
    boolean createCategory(Category category);
    
    boolean renameCategory(Long categoryId, String newName);
    
    boolean deleteCategory(Long id);
    
    boolean saveArticle(Long categoryId, Article article);
    
    boolean modifyArticleById(Long id, Long cid, Article article);
    
    boolean deleteArticleById(Long id);
    
    boolean changeArticlesCategory(Long articleId, Long categoryId);
    
    boolean leaveMessage2Article(Long articleId, Message message);
    
    boolean deleteMessage4Article(Long messageId);
    
    boolean comment2Message(Long messageId, Comment comment);
    
    boolean deleteComment4Message(Long commentId);
    
    List<Category> queryAllCategorys();
    
    Collection<Map<String, String>> queryAllCategoryList();
    
    Category queryCategoryById(Long categoryId);
    
    Collection<Article> queryAllArticles(int pageNo);
    
    Collection<Article> queryArticlesByCategoryId(Long categoryId);
    
    Article queryArticleByPostName(String postName);
    
    Article queryArticleByArticleId(Long articleId, String ip);
    
    Collection<Message> queryMessagesByArticleId(Long articleId);
    
    Collection<Comment> queryCommentsByMessageId(Long messageId);
}
